function padTo2Digits(num) {
  return num.toString().padStart(2, "0");
}

export function getCurrentDate() {
  const now = new Date();
  const year = now.getFullYear();
  const month = padTo2Digits(now.getMonth() + 1); // getMonth() 返回的是 0-11，所以需要加 1
  const day = padTo2Digits(now.getDate());
  const hour = padTo2Digits(now.getHours());
  const minute = padTo2Digits(now.getMinutes());
  const second = padTo2Digits(now.getSeconds());

  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
